
<div id="center_tieude">
    <img src="../../Picture/admin.ico"/>
    <h3>Danh Sách Góp Ý</h3>        
</div> <!--end id center_tieude-->

<div id="timkiem_them">
<form action="" method="post">
    <select name="timkiem_gopy">
        <option value="chude">Tìm theo chủ đề</option>
        <option value="ngay">Tìm theo ngày góp ý</option>
    </select>
    <label style="float:left; margin:10px;">Từ khóa:</label>
    <input style="float:left; margin:10px;" type="search" name="key"/>
    <input style="float:left; margin:10px;" type="submit" name="timkiem" value="Tìm Kiếm"/>
</form>
</div><!--end id timkiem_them-->
<table border="1px" cellspacing="0px" width="700px">
  <tr>
      <th>
          ID
      </th>
      <th>
          Chủ đề
      </th>
      <th>
          Ngày Góp Ý
      </th>
      <th>
         <span style="width:40px; overflow:scroll;">Nội Dung</span>
      </th>
      <th>
          Tên Người Góp Ý
      </th>
      <th>
          Email
      </th>
  </tr>
  
  <?php
	  		if(isset($_GET['trang']))
			{
				$page=$_GET['trang'];
				$arr=gopy::GetAll($page,7);
				for($i=0;$i<count($arr);$i++)     
				{    
				?>  	
					 <tr>
                          <td>
                              <?php echo $arr[$i]->idGopY; ?>
                          </td>
                          <td>
                              <?php echo $arr[$i]->ChuDeGopY; ?>
                          </td>
                          <td>
                             <?php echo $arr[$i]->NgayGopY; ?>
                          </td>
                          <td>
                              <span style="width:40px; overflow:scroll;"> <?php echo $arr[$i]->NoiDungGopY; ?></span>
                          </td>
                          <td>
                             <?php echo $arr[$i]->TenKhachGopY; ?>
                          </td>
                          <td>
                              <?php echo $arr[$i]->Email; ?>
                          </td>
                          <td>
                              <a href="admin.php?obj=gopy&act=delete&id=<?php echo $arr[$i]->idGopY; ?>"><img title="Xóa góp ý" alt="Xóa góp ý" src="../../Picture/del.png"/></a>
                          </td>
                          <td>
                                <a href="admin.php?obj=gopy&act=print&id=<?php echo $arr[$i]->idGopY; ?> " target="_blank"><img title="In góp ý" alt="In góp ý" src="../../Picture/print.png"/></a>
                          </td>
                          <td>
                              <a href="admin.php?obj=gopy&act=reply"><img title="Phản hồi góp ý" alt="Phản hồi" src="../../Picture/reply.png"/></a>
                          </td>
                      </tr>
     <?php
          		}
			}
			else
			{
				$page=1;
				$arr=gopy::GetAll($page,7);
				for($i=0;$i<count($arr);$i++)     
				{    
				?>  	
					 <tr>
                        <td>
                            <?php echo $arr[$i]->idGopY; ?>
                        </td>
                        <td>
                            <?php echo $arr[$i]->ChuDeGopY; ?>
                        </td>
                        <td>
                           <?php echo $arr[$i]->NgayGopY; ?>
                        </td>
                        <td>
                            <span style="width:40px; overflow:scroll;"> <?php echo $arr[$i]->NoiDungGopY; ?></span>
                        </td>
                        <td>
                           <?php echo $arr[$i]->TenKhachGopY; ?>
                        </td>
                        <td>
                            <?php echo $arr[$i]->Email; ?>
                        </td>
                        <td>
                            <a href="admin.php?obj=gopy&act=delete&id=<?php echo $arr[$i]->idGopY; ?>"><img title="Xóa góp ý" alt="Xóa góp ý" src="../../Picture/del.png"/></a>
                        </td>
                        <td>
                              <a href="admin.php?obj=gopy&act=print&id=<?php echo $arr[$i]->idGopY; ?> " target="_blank"><img title="In góp ý" alt="In góp ý" src="../../Picture/print.png"/></a>
                        </td>
                        <td>
                            <a href="admin.php?obj=gopy&act=reply"><img title="Phản hồi góp ý" alt="Phản hồi" src="../../Picture/reply.png"/></a>
                        </td>
                    </tr>
     <?php
          		}
			}		
      ?>

</table><!--end class danhmuc-->
<div id="trang">
	<?php
		if(!isset($_GET["trang"]))
			$_GET["trang"]=1;
		if(isset($_GET["obj"])&&$_GET["obj"]=='gopy')
		{
		$a = gopy::CountGopY();
		$sotrang = ceil($a/7);
		$hientai = $_GET["trang"];
			for ($page = 1;(int)$page<=$sotrang;$page++ )
			{
				if($hientai != $page)
				{ echo "
					<a href='admin.php?obj=gopy&trang=$page'>$page</a>";
				}
				else
				{
					echo "<b>".$page."</b>";
				}
			}
		}
		
?>
</div>

</table><!--end class danhmuc-->